package com.example.service;

import com.example.dao.MenuDao;
import com.example.dao.UserDao;
import com.example.dao.impl.MenuDaoImpl;
import com.example.dao.impl.UserDaoImpl;
import com.example.entity.IndexInfo;
import com.example.entity.Resource;
import com.example.entity.User;
import com.example.utils.ResultData;
import lombok.Data;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Objects;
@Data
@Service
public class UserService {
UserDao userDao=new UserDaoImpl();
    public ResultData login(User user) {
        ResultData resultData=new ResultData();
        User user1=userDao.selectByUserName(user.getUsername());
        if(Objects.isNull(user1)){
            resultData.setCode(404);
            resultData.setMsg("账号密码错误");
        }else {
            resultData.setCode(200);
            resultData.setMsg("登录成功");
        }
        return resultData;
    }
}
